eaa05760beccb1ec1fa1c5f84542dd7851651cbb,tests/test_apps/schemachange/src/schemachange/SchemaChangeClient.java,SchemaChangeClient,runTestWorkload,#,514

Before Change


        // kick this off with a random schema
        VoltTable t = null;
        while (t == null) {
            t = catalogChange(null, true);
        }

        startTime = System.currentTimeMillis();

After Change


        VoltTable t = null;
        TableHelper.ViewRep v = null;
        while (t == null) {
            Pair<VoltTable, TableHelper.ViewRep> schema = catalogChange(null, true, null);
            t = schema.getFirst();
            v = schema.getSecond();
        }

        startTime = System.currentTimeMillis();

        while (config.duration == 0 || (System.currentTimeMillis() - startTime < (config.duration * 1000))) {

            // make sure the table is full and mess around with it
            loadTable(t);

            for (int j = 0; j < 3; j++) {

                String tableName = TableHelper.getTableName(t);

                // deterministically sample some rows
                VoltTable preT = null;
                long max = maxId(t);
                long sampleOffset = -1;
                if (max > 0) {
                    sampleOffset = Math.min((long) (max * .75), max - 100);
                    assert(max >= 0);
                    preT = sample(sampleOffset, t);
                    assert(preT.getRowCount() > 0);
                    log.info(_F("Sampled table %s from offset %d limit 100 and found %d rows.",
                            tableName, sampleOffset, preT.getRowCount()));
                }
                //log.info(_F("First sample:\n%s", preT.toFormattedString()));

                // move to an entirely new table or migrated schema
                VoltTable newT = null;
                TableHelper.ViewRep newV = null;
                boolean isNewTable = (j == 0) && (rand.nextInt(5) == 0);
                while (newT == null) {
                    Pair<VoltTable, TableHelper.ViewRep> schema = catalogChange(t, isNewTable, v);
                    newT = schema.getFirst();
                    newV = schema.getSecond();
                }
                t = newT;
                v = newV;

                // if the table has been migrated, check the data
                if (!isNewTable && (preT != null)) {